//
//  UIColor.swift
//  Automobile
//
//  Created by erkebulan elzhan on 7/19/20.
//  Copyright © 2020 erkebulan elzhan. All rights reserved.
//

import UIKit


extension UIColor {
    
    // MARK: - Main Colors
    
    // light colors
    static let lightBlueColor = #colorLiteral(red: 0.937254902, green: 0.9490196078, blue: 0.968627451, alpha: 1) // 239
    static let whiteBlueColor = #colorLiteral(red: 0.9764705882, green: 0.9803921569, blue: 0.9882352941, alpha: 1) // 249
    static let greyBlue = #colorLiteral(red: 0.8274509804, green: 0.8823529412, blue: 0.9019607843, alpha: 1) // (211, 220, 230)
    static let mediumGreyBlue = UIColor.rgb(194, 209, 219)
    
    // blue colors
    static let blueColor = #colorLiteral(red: 0.1843137255, green: 0.5098039216, blue: 0.8235294118, alpha: 1)
    static let mediumDarkBlue = UIColor.rgb(60, 75, 88)
    static let darkBlueColor = #colorLiteral(red: 0.1215686275, green: 0.1764705882, blue: 0.2392156863, alpha: 1)
    
    // grey colors
    static let greyColor = #colorLiteral(red: 0.5176470588, green: 0.5725490196, blue: 0.6509803922, alpha: 1) //132

    
    
    
    
    
    static func rgb(_ red: CGFloat, _ green: CGFloat, _ blue: CGFloat) -> UIColor {
        return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: 1)
    }
}



extension String {
    func capitalizingFirstLetter() -> String {
        return prefix(1).capitalized + dropFirst()
    }

    mutating func capitalizeFirstLetter() {
        self = self.capitalizingFirstLetter()
    }
}


extension Array {
    func item(at index: Int) -> Element? {
        return indices.contains(index) ? self[index] : nil
    }
}

